package com.sap.tpcd.policybuilder.policymodel ;


/**
 * @author I068988
 * @version 1.0
 * @created 30-sept.-2011 14:12:34
 */
public class DataProtection extends Policy {

	private PolicyElement algorithmeSuite;
	private PolicyElement protocol;
	private PolicyElement service;

	public DataProtection(){
		super();
	}

	public DataProtection(PolicyElement algorithmeSuite,PolicyElement protocol,
			PolicyElement service) {
		super();
		this.algorithmeSuite = algorithmeSuite;
		this.protocol = protocol;
		this.service = service;
	}
	

	/* (non-Javadoc)
	 * @see com.sap.tpcd.policyhandler.Policy#getPolicyName()
	 */
	@Override
	public String getPolicyName() {
		// TODO Auto-generated method stub
		return super.getPolicyName();
	}

	/* (non-Javadoc)
	 * @see com.sap.tpcd.policyhandler.Policy#setPolicyName(java.lang.String)
	 */
	@Override
	public void setPolicyName(String policyName) {
		// TODO Auto-generated method stub
		super.setPolicyName(policyName);
	}

	/* (non-Javadoc)
	 * @see com.sap.tpcd.policyhandler.Policy#getM_PolicyElement()
	 */
	@Override
	public PolicyElement getM_PolicyElement() {
		// TODO Auto-generated method stub
		return super.getM_PolicyElement();
	}

	/* (non-Javadoc)
	 * @see com.sap.tpcd.policyhandler.Policy#setM_PolicyElement(com.sap.tpcd.policyhandler.PolicyElement)
	 */
	@Override
	public void setM_PolicyElement(PolicyElement m_PolicyElement) {
		// TODO Auto-generated method stub
		super.setM_PolicyElement(m_PolicyElement);
	}



	/**
	 * @return the protocol
	 */
	public PolicyElement getProtocol() {
		return protocol;
	}

	/**
	 * @param protocol the protocol to set
	 */
	public void setProtocol(PolicyElement protocol) {
		this.protocol = protocol;
	}

	/**
	 * @return the service
	 */
	public PolicyElement getService() {
		return service;
	}

	/**
	 * @param service the service to set
	 */
	public void setService(PolicyElement service) {
		this.service = service;
	}
	
	public PolicyElement getAlgorithmeSuite() {
		return algorithmeSuite;
	}

	public void setAlgorithmeSuite(PolicyElement algorithmeSuite) {
		this.algorithmeSuite = algorithmeSuite;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result
				+ ((algorithmeSuite == null) ? 0 : algorithmeSuite.hashCode());
		result = prime * result
				+ ((protocol == null) ? 0 : protocol.hashCode());
		result = prime * result + ((service == null) ? 0 : service.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (!(obj instanceof DataProtection)) {
			return false;
		}
		DataProtection other = (DataProtection) obj;

		if (algorithmeSuite == null) {
			if (other.algorithmeSuite != null) {
				return false;
			}
		} else if (!algorithmeSuite.equals(other.algorithmeSuite)) {
			return false;
		}
		if (protocol == null) {
			if (other.protocol != null) {
				return false;
			}
		} else if (!protocol.equals(other.protocol)) {
			return false;
		}
		if (service == null) {
			if (other.service != null) {
				return false;
			}
		} else if (!service.equals(other.service)) {
			return false;
		}
		return true;
	}
	
	/* public String toStrint()
	{
		return "DP(" + getService(). + ", "
				+ dpCollector.protocol + ", " + dpCollector.conf + ", "
				+ dpCollector.getInteg() + ")" ;
	}
	*/
	

}